HAL FLASH constants migration ¶
This section provides information about the HAL FLASH constants migration.
Note
In HAL1, the FLASH driver manages Flash memory operations.
In HAL2, depending on the device family, memory operations are managed either by the FLASH driver or by the NVM driver.
In this migration guide, when a constant or concept exists in both HAL2 FLASH and HAL2 NVM, the migration is illustrated using the HAL2 FLASH name. The same naming rule applies to HAL2 NVM.
Example: in HAL1,
FLASH_BANK_1constant becomes:HAL_FLASH_BANK_1in HAL2 FLASH driver.HAL_NVM_BANK_1in HAL2 NVM driver.
For NVM-based families, the NVM driver provides programming services similar to those of FLASH with minor differences:
There is no erase step for NVM memories.
Erase-by-address, page erase, bank erase, and FLASH mass erase remain FLASH-specific.
For NVM-based families, the only erase service that may be exposed is OBK erase, when that feature exists.
HAL FLASH bank identifiers constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_BANK_1
#define FLASH_BANK_2
#define FLASH_BANK_BOTH
|
typedef enum
{
HAL_FLASH_BANK_1,
HAL_FLASH_BANK_2,
HAL_FLASH_BANK_ALL
} hal_flash_bank_t;
|
Related concepts:
HAL FLASH bank privilege levels constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_BB_PRIV
#define FLASH_BB_SEC
|
Removed ; instead four dedicated APIs have been provided to explicitly configure the privilege level and security attribute:
|
Related concepts:
HAL FLASH CRC burst size constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_CRC_BURST_SIZE_4
#define FLASH_CRC_BURST_SIZE_16
#define FLASH_CRC_BURST_SIZE_64
#define FLASH_CRC_BURST_SIZE_256
|
typedef enum
{
HAL_FLASH_CRC_BURST_SIZE_4,
HAL_FLASH_CRC_BURST_SIZE_16,
HAL_FLASH_CRC_BURST_SIZE_64,
HAL_FLASH_CRC_BURST_SIZE_256
} hal_flash_crc_burst_size_t;
|
Related concepts:
HAL FLASH security inversion constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define FLASH_INV_DISABLE
#define FLASH_INV_ENABLE
|
In
typedef enum
{
HAL_FLASH_CLK_SEC_NOT_INVERTED,
HAL_FLASH_CLK_SEC_INVERTED
} hal_flash_clk_sec_invert_state_t;
|
Related concepts:
HAL FLASH error interrupt constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define FLASH_IT_ALL
#define FLASH_IT_ALL_BANK1
#define FLASH_IT_ALL_BANK2
#define FLASH_IT_CRCEND_BANK1
#define FLASH_IT_CRCEND_BANK2
#define FLASH_IT_CRCRDERR_BANK1
#define FLASH_IT_CRCRDERR_BANK2
#define FLASH_IT_DBECCERR_BANK1
#define FLASH_IT_DBECCERR_BANK2
#define FLASH_IT_ECCC
#define FLASH_IT_ECCC1
#define FLASH_IT_ECCC2
#define FLASH_IT_EOP
#define FLASH_IT_EOP_BANK1
#define FLASH_IT_EOP_BANK2
#define FLASH_IT_ERR
#define FLASH_IT_INCERR
#define FLASH_IT_INCERR_BANK1
#define FLASH_IT_INCERR_BANK2
#define FLASH_IT_OBKERR
#define FLASH_IT_OBKWERR
#define FLASH_IT_OPERR
#define FLASH_IT_OPERR_BANK1
#define FLASH_IT_OPERR_BANK2
#define FLASH_IT_OPTCHANGEERR
#define FLASH_IT_PGSERR
#define FLASH_IT_PGSERR_BANK1
#define FLASH_IT_PGSERR_BANK2
#define FLASH_IT_RDERR
#define FLASH_IT_RDPERR_BANK1
#define FLASH_IT_RDPERR_BANK2
#define FLASH_IT_RDSERR_BANK1
#define FLASH_IT_RDSERR_BANK2
#define FLASH_IT_SNECCERR_BANK1
#define FLASH_IT_SNECCERR_BANK2
#define FLASH_IT_STRBERR
#define FLASH_IT_STRBERR_BANK1
#define FLASH_IT_STRBERR_BANK2
#define FLASH_IT_WRPERR
#define FLASH_IT_WRPERR_BANK1
#define FLASH_IT_WRPERR_BANK2
|
In
For more details, refer to: Enable interrupt macro and Disable interrupt macro Important
|
Related concepts:
HAL FLASH error codes constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define HAL_FLASH_ERROR_NONE
#define HAL_FLASH_ERROR_FAST
#define HAL_FLASH_ERROR_MISS
#define HAL_FLASH_ERROR_OBK
#define HAL_FLASH_ERROR_OBKW
#define HAL_FLASH_ERROR_OP
#define HAL_FLASH_ERROR_OPE
#define HAL_FLASH_ERROR_OPERATION
#define HAL_FLASH_ERROR_OPE_BANK1
#define HAL_FLASH_ERROR_OPE_BANK2
#define HAL_FLASH_ERROR_OPTV
#define HAL_FLASH_ERROR_PGA
#define HAL_FLASH_ERROR_PGS
#define HAL_FLASH_ERROR_PGS_BANK1
#define HAL_FLASH_ERROR_PGS_BANK2
#define HAL_FLASH_ERROR_PROG
#define HAL_FLASH_ERROR_RD
#define HAL_FLASH_ERROR_RDP
#define HAL_FLASH_ERROR_RDP_BANK1
#define HAL_FLASH_ERROR_RDP_BANK2
#define HAL_FLASH_ERROR_SIZ
#define HAL_FLASH_ERROR_STRB
#define HAL_FLASH_ERROR_STRB_BANK1
#define HAL_FLASH_ERROR_STRB_BANK2
#define HAL_FLASH_ERROR_WRP
#define HAL_FLASH_ERROR_WRP_BANK1
#define HAL_FLASH_ERROR_WRP_BANK2
#define HAL_FLASH_ERROR_CRCRD
#define HAL_FLASH_ERROR_CRCRD_BANK1
#define HAL_FLASH_ERROR_CRCRD_BANK2
|
In
#define HAL_FLASH_ERROR_NONE
#define HAL_FLASH_ERROR_FAST
#define HAL_FLASH_ERROR_MISS
#define HAL_FLASH_ERROR_OBK
#define HAL_FLASH_ERROR_OBKW
#define HAL_FLASH_ERROR_OP
#define HAL_FLASH_BANK1_ERROR_OP
#define HAL_FLASH_BANK2_ERROR_OP
#define HAL_FLASH_ERROR_OPTV
#define HAL_FLASH_ERROR_PGA
#define HAL_FLASH_ERROR_PGS
#define HAL_FLASH_BANK1_ERROR_PGS
#define HAL_FLASH_BANK2_ERROR_PGS
#define HAL_FLASH_ERROR_PROG
#define HAL_FLASH_ERROR_RD
#define HAL_FLASH_BANK1_ERROR_RD
#define HAL_FLASH_BANK2_ERROR_RD
#define HAL_FLASH_ERROR_SIZE
#define HAL_FLASH_ERROR_STRB
#define HAL_FLASH_BANK1_ERROR_STRB
#define HAL_FLASH_BANK2_ERROR_STRB
#define HAL_FLASH_ERROR_WRP
#define HAL_FLASH_BANK1_ERROR_WRP
#define HAL_FLASH_BANK2_ERROR_WRP
#define HAL_FLASH_ERROR_CRCR
#define HAL_FLASH_BANK1_ERROR_CRCR
#define HAL_FLASH_BANK2_ERROR_CRCR
|
Note
Errors related to option bytes are handled internally by the
HAL_FLASH_ITF_OB_Program
APIs.
In the event of an option byte programming failure, the API returns
HAL_ERROR.
HAL FLASH ECC areas constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define HAL_FLASH_ERROR_ECCC
#define HAL_FLASH_ERROR_ECCC2
#define HAL_FLASH_ERROR_ECCD
#define HAL_FLASH_ERROR_ECCD2
#define HAL_FLASH_ERROR_SNECC
#define HAL_FLASH_ERROR_SNECC_BANK1
#define HAL_FLASH_ERROR_SNECC_BANK2
#define HAL_FLASH_ERROR_DBECC
#define HAL_FLASH_ERROR_DBECC_BANK1
#define HAL_FLASH_ERROR_DBECC_BANK2
|
In HAL2, all the various ECC error constants from HAL1 are combined into a single enum,
typedef enum
{
HAL_FLASH_ECC_NONE, /* New in HAL2 */
HAL_FLASH_ECC_SINGLE,
HAL_FLASH_ECC_DOUBLE
} hal_flash_ecc_type_t;
|
Related concepts:
HAL FLASH status flags constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define FLASH_FLAG_ALL_BANK1
#define FLASH_FLAG_ALL_BANK2
#define FLASH_FLAG_ALL_ERRORS
#define FLASH_FLAG_ALL_ERRORS_BANK1
#define FLASH_FLAG_ALL_ERRORS_BANK2
#define FLASH_FLAG_BSY
#define FLASH_FLAG_BSY1
#define FLASH_FLAG_BSY2
#define FLASH_FLAG_BSY_BANK1
#define FLASH_FLAG_BSY_BANK2
#define FLASH_FLAG_CFGBSY
#define FLASH_FLAG_CRCEND
#define FLASH_FLAG_CRCEND_BANK1
#define FLASH_FLAG_CRCEND_BANK2
#define FLASH_FLAG_CRCRDERR
#define FLASH_FLAG_CRCRDERR_BANK1
#define FLASH_FLAG_CRCRDERR_BANK2
#define FLASH_FLAG_CRC_BUSY
#define FLASH_FLAG_CRC_BUSY_BANK1
#define FLASH_FLAG_CRC_BUSY_BANK2
#define FLASH_FLAG_DBECCERR
#define FLASH_FLAG_DBECCERR_BANK1
#define FLASH_FLAG_DBECCERR_BANK2
#define FLASH_FLAG_DBNE
#define FLASH_FLAG_ECCR_ERRORS
#define FLASH_FLAG_EOP
#define FLASH_FLAG_EOP_BANK1
#define FLASH_FLAG_EOP_BANK2
#define FLASH_FLAG_FASTERR
#define FLASH_FLAG_INCERR
#define FLASH_FLAG_INCERR_BANK1
#define FLASH_FLAG_INCERR_BANK2
#define FLASH_FLAG_MISERR
#define FLASH_FLAG_OBKERR
#define FLASH_FLAG_OBKWERR
#define FLASH_FLAG_OPERR
#define FLASH_FLAG_OPERR_BANK1
#define FLASH_FLAG_OPERR_BANK2
#define FLASH_FLAG_OPTCHANGEERR
#define FLASH_FLAG_OPTVERR
#define FLASH_FLAG_OPTWERR
#define FLASH_FLAG_PEMPTY
#define FLASH_FLAG_PESD
#define FLASH_FLAG_PGAERR
#define FLASH_FLAG_PGPERR
#define FLASH_FLAG_PGSERR
#define FLASH_FLAG_PGSERR_BANK1
#define FLASH_FLAG_PGSERR_BANK2
#define FLASH_FLAG_PROGERR
#define FLASH_FLAG_QW
#define FLASH_FLAG_QW_BANK1
#define FLASH_FLAG_QW_BANK2
#define FLASH_FLAG_RDERR
#define FLASH_FLAG_RDPERR
#define FLASH_FLAG_RDPERR_BANK1
#define FLASH_FLAG_RDPERR_BANK2
#define FLASH_FLAG_RDSERR
#define FLASH_FLAG_RDSERR_BANK1
#define FLASH_FLAG_RDSERR_BANK2
#define FLASH_FLAG_SIZERR
#define FLASH_FLAG_SNECCERR
#define FLASH_FLAG_SNECCERR_BANK1
#define FLASH_FLAG_SNECCERR_BANK2
#define FLASH_FLAG_SR_ERRORS
#define FLASH_FLAG_STRBERR
#define FLASH_FLAG_STRBERR_BANK1
#define FLASH_FLAG_STRBERR_BANK2
#define FLASH_FLAG_WBNE
#define FLASH_FLAG_WBNE_BANK1
#define FLASH_FLAG_WBNE_BANK2
#define FLASH_FLAG_WDW
#define FLASH_FLAG_WRPERR
#define FLASH_FLAG_WRPERR_BANK1
#define FLASH_FLAG_WRPERR_BANK2
#define FLASH_FLAG_ECCC
#define FLASH_FLAG_ECCC1
#define FLASH_FLAG_ECCC2
#define FLASH_FLAG_ECCD
#define FLASH_FLAG_ECCD1
#define FLASH_FLAG_ECCD2
|
In
For more details, refer to: |
Related concepts:
HAL FLASH keys constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_KEY1
#define FLASH_KEY2
|
Removed
; used internally by the HAL lock APIs (moved to the
|
Related concepts:
HAL FLASH latency values constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_LATENCY_0
#define FLASH_LATENCY_1
#define FLASH_LATENCY_2
#define FLASH_LATENCY_3
#define FLASH_LATENCY_4
#define FLASH_LATENCY_5
#define FLASH_LATENCY_6
#define FLASH_LATENCY_7
#define FLASH_LATENCY_8
#define FLASH_LATENCY_9
#define FLASH_LATENCY_10
#define FLASH_LATENCY_11
#define FLASH_LATENCY_12
#define FLASH_LATENCY_13
#define FLASH_LATENCY_14
#define FLASH_LATENCY_15
|
typedef enum
{
HAL_FLASH_ITF_LATENCY_0,
HAL_FLASH_ITF_LATENCY_1,
HAL_FLASH_ITF_LATENCY_2,
HAL_FLASH_ITF_LATENCY_3,
HAL_FLASH_ITF_LATENCY_4,
HAL_FLASH_ITF_LATENCY_5,
HAL_FLASH_ITF_LATENCY_6,
HAL_FLASH_ITF_LATENCY_7,
HAL_FLASH_ITF_LATENCY_8,
HAL_FLASH_ITF_LATENCY_9,
HAL_FLASH_ITF_LATENCY_10,
HAL_FLASH_ITF_LATENCY_11,
HAL_FLASH_ITF_LATENCY_12,
HAL_FLASH_ITF_LATENCY_13,
HAL_FLASH_ITF_LATENCY_14,
HAL_FLASH_ITF_LATENCY_15,
} hal_flash_itf_latency_t;
|
Related concepts:
HAL FLASH low power mode enable/disable constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In HAL1, these values are passed as arguments to
#define FLASH_LPM_ENABLE
#define FLASH_LPM_DISABLE
|
Removed ; in HAL2, this has been replaced by dedicated unitary APIs: HAL_FLASH_ITF_EnableLowPWRReadMode()
HAL_FLASH_ITF_DisableLowPWRReadMode()
|
Related concepts:
HAL FLASH OBK Key identifiers constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_OBK_KEY1
#define FLASH_OBK_KEY2
|
Removed
; used internally by the HAL OBK lock APIs (moved to the
|
Related concepts:
HAL FLASH OBK swap offset identifiers constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_OBK_SWAP_OFFSET_ALL
#define FLASH_OBK_SWAP_OFFSET_HDPL0
#define FLASH_OBK_SWAP_OFFSET_HDPL1
#define FLASH_OBK_SWAP_OFFSET_HDPL2
#define FLASH_OBK_SWAP_OFFSET_HDPL3_S
#define FLASH_OBK_SWAP_OFFSET_NO_DATA
|
typedef enum
{
HAL_FLASH_ITF_OBK_AREA_1,
HAL_FLASH_ITF_OBK_AREA_2,
...
} hal_flash_itf_obk_area_t;
These defines and the corresponding HAL2 enumeration are product-dependent. Please refer to the device reference manual and the HAL documentation to identify the exact values applicable to your specific device. |
Related concepts:
HAL FLASH operation type identifiers constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_OPERATION_TYPE_NONE
#define FLASH_OPERATION_TYPE_QUADWORD
#define FLASH_OPERATION_TYPE_BURST
#define FLASH_OPERATION_TYPE_PAGEERASE
#define FLASH_OPERATION_TYPE_BANKERASE
#define FLASH_OPERATION_TYPE_SECTORERASE
#define FLASH_OPERATION_TYPE_MASSERASE
#define FLASH_OPERATION_TYPE_OPTIONCHANGE
#define FLASH_OPERATION_TYPE_OBKALTERASE
#define FLASH_OPERATION_TYPE_OBKSWAP
#define FLASH_OPERATION_AREA_BANK_1
#define FLASH_OPERATION_AREA_BANK_2
#define FLASH_OPERATION_AREA_SYSF
#define FLASH_OPERATION_AREA_DATA
#define FLASH_OPERATION_AREA_OTP
|
typedef enum
{
HAL_FLASH_INTERRUPTED_NO_OPERATION,
HAL_FLASH_INTERRUPTED_SINGLE_WRITE,
HAL_FLASH_INTERRUPTED_BURST_WRITE,
HAL_FLASH_INTERRUPTED_PAGE_ERASE,
HAL_FLASH_INTERRUPTED_BANK_ERASE,
HAL_FLASH_INTERRUPTED_SECTOR_ERASE
HAL_FLASH_INTERRUPTED_MASS_ERASE,
HAL_FLASH_INTERRUPTED_OB_CHANGE,
HAL_FLASH_INTERRUPTED_OBK_ALT_PAGE_ERASE,
HAL_FLASH_INTERRUPTED_OBK_SWAP_PAGE
/* Not yet implemented*/
/* Not yet implemented*/
/* Not yet implemented*/
/* Not yet implemented*/
/* Not yet implemented*/
} hal_flash_interrupted_operation_t;
|
Related concept:
HAL FLASH option keys constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_OPT_KEY1
#define FLASH_OPT_KEY2
#define FLASH_OPTKEY1
#define FLASH_OPTKEY2
|
Removed
; used internally by the HAL option bytes lock APIs (moved to the
|
Related concepts:
HAL FLASH power-down keys constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_PDKEY1
#define FLASH_PDKEY1_1
#define FLASH_PDKEY1_2
#define FLASH_PDKEY2
#define FLASH_PDKEY2_1
#define FLASH_PDKEY2_2
|
Removed
; used internally by the HAL Power Down APIs (moved to the
|
Related concepts:
HAL FLASH programming delay values constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define FLASH_PROGRAMMING_DELAY_0
#define FLASH_PROGRAMMING_DELAY_1
#define FLASH_PROGRAMMING_DELAY_2
#define FLASH_PROGRAMMING_DELAY_3
|
In
typedef enum
{
HAL_FLASH_ITF_PROGRAM_DELAY_0,
HAL_FLASH_ITF_PROGRAM_DELAY_1,
HAL_FLASH_ITF_PROGRAM_DELAY_2,
HAL_FLASH_ITF_PROGRAM_DELAY_3
} hal_flash_itf_program_delay_t;
|
Related concepts:
Note
The Internal Empty Check flag (the
EMPTY
bit in the FLASH access control register,
FLASH_ACR) is designed to facilitate easy programming of virgin (unprogrammed) devices by the bootloader.
This flag is evaluated when the boot configuration specifies the main flash memory as the target boot area and the
BOOT_LOCKbit is not set.If the
EMPTYflag is set, the device is considered empty (unprogrammed).In this case, the system automatically selects the system memory (bootloader) as the boot area instead of the main flash memory.
This mechanism enables the user to program the device via the bootloader on an empty device.
It is not affected by the system reset.
For a detailed explanation of the bootloader operation and GPIO configuration in system memory boot mode (including the reconfiguration of some GPIOs from their default High-Z state), please refer to AN2606.
HAL FLASH programming status constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define FLASH_PROG_NOT_EMPTY
#define FLASH_PROG_EMPTY
|
In
typedef enum
{
HAL_FLASH_ITF_BOOT_LOCATION_PROGRAMMED,
HAL_FLASH_ITF_BOOT_LOCATION_EMPTY
} hal_flash_itf_empty_boot_location_t;
|
Related concepts:
HAL FLASH secure privilege status constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define FLASH_SPRIV_DENIED
#define FLASH_SPRIV_GRANTED
#define FLASH_NSPRIV_DENIED
#define FLASH_NSPRIV_GRANTED
|
In
typedef enum
{
HAL_FLASH_ITF_NPRIV,
HAL_FLASH_ITF_PRIV
} hal_flash_itf_priv_attr_t;
Note Check the possible values of item according to the given series. |
Related concepts:
HAL FLASH erase type definitions constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In
#define FLASH_TYPEERASE_MASS
#define FLASH_TYPEERASE_MASSERASE
#define FLASH_TYPEERASE_MASSERASE_NS
#define FLASH_TYPEERASE_OBK_ALT
#define FLASH_TYPEERASE_PAGES
#define FLASH_TYPEERASE_PAGES_NS
|
In
The erase sequence has been redesigned to provide dedicated functions for each operation type, including mass erase, OBK mass erase, page erase, and erase by address, all available in both polling and interrupt modes. Non-secure variants are also provided for applicable series.
|
Related concepts:
HAL FLASH programming types constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_TYPEPROGRAM_BURST
#define FLASH_TYPEPROGRAM_BYTE
#define FLASH_TYPEPROGRAM_DOUBLEWORD
#define FLASH_TYPEPROGRAM_FAST
#define FLASH_TYPEPROGRAM_QUADWORD
#define FLASH_TYPEPROGRAM_WORD /*or FLASHWORD */
#define FLASH_TYPEPROGRAM_HALFWORD
#define FLASH_TYPEPROGRAM_OTPWORD
#define FLASH_TYPEPROGRAM_BURST_NS
#define FLASH_TYPEPROGRAM_QUADWORD_NS
#define FLASH_TYPEPROGRAM_HALFWORD_EDATA
#define FLASH_TYPEPROGRAM_HALFWORD_EDATA_NS
#define FLASH_TYPEPROGRAM_HALFWORD_OTP
#define FLASH_TYPEPROGRAM_QUADWORD_OBK
#define FLASH_TYPEPROGRAM_QUADWORD_OBK_ALT
#define FLASH_TYPEPROGRAM_WORD_EDATA
#define FLASH_TYPEPROGRAM_WORD_EDATA_NS
In
|
typedef enum
{
HAL_FLASH_PROGRAM_BURST,
HAL_FLASH_PROGRAM_BYTE,
HAL_FLASH_PROGRAM_DOUBLEWORD,
HAL_FLASH_PROGRAM_FAST,
HAL_FLASH_PROGRAM_QUADWORD,
HAL_FLASH_PROGRAM_WORD,
HAL_FLASH_PROGRAM_HALFWORD,
/* Removed / Sequence changed */
/* Removed / Sequence changed */
/* Removed / Sequence changed */
/* Removed / Sequence changed */
/* Removed / Sequence changed */
/* Removed / Sequence changed */
/* Removed / Sequence changed */
/* Removed / Sequence changed */
/* Removed / Sequence changed */
/* Removed / Sequence changed */
}hal_flash_program_mode_t;
For the programming types that have been removed or whose sequence has changed in HAL2:
For more information, please refer to Program Polling, obk area program |
Related concepts:
HAL FLASH option byte BKPRAM ECC constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_BKPRAM_ECC_DISABLE
#define OB_BKPRAM_ECC_ENABLE
|
Removed
; in
HAL_FLASH_ITF_OB_DisableSRAMECC(HAL_FLASH, HAL_FLASH_ITF_OB_BKPSRAM)
HAL_FLASH_ITF_OB_EnableSRAMECC(HAL_FLASH, HAL_FLASH_ITF_OB_BKPSRAM)
|
|
Example: The BKPSRAM ECC option byte (OB) can be enabled using the following code FLASH_OBProgramInitTypeDef ob = {0};
/* USER group contains BKPRAM ECC bit on supported series */
ob.OptionType = OPTIONBYTE_USER;
/* fetch current USERConfig / dedicated BKPRAM ECC field */
HAL_FLASHEx_OBGetConfig(&ob);
if(ENABLE) { ob.USERConfig |= OB_USER_BKPRAM_ECC; }
else { ob.USERConfig &= ~OB_USER_BKPRAM_ECC; }
HAL_FLASHEx_OBProgram(&ob);
|
In
HAL_FLASH_ITF_OB_EnableSRAMECC(HAL_FLASH, HAL_FLASH_ITF_OB_BKPSRAM);
|
Related concepts:
Related use case:
HAL FLASH option byte user configuration constants ¶
|
HAL1 |
HAL2 |
|---|---|
|
In HAL1, these constants were used to configure user option bytes collectively.
/*USER_OPTIONBYTE*/
#define OB_USER_ALL
#define OB_USER_BANK_SWAP
#define OB_USER_BCM4
#define OB_USER_BCM7
#define OB_USER_BFB2
#define OB_USER_BKPRAM_ECC
#define OB_USER_BOOT_UBE
#define OB_USER_BORH_EN
#define OB_USER_BOR_EN
#define OB_USER_BOR_LEV
#define OB_USER_CCMSRAM_RST
#define OB_USER_DBANK
#define OB_USER_DUALBANK
#define OB_USER_DUALBANK_DISABLE
#define OB_USER_DUALBANK_ENABLE
#define OB_USER_DUALBANK_SWAP_DISABLE
#define OB_USER_DUALBANK_SWAP_ENABLE
#define OB_USER_DUAL_BANK
#define OB_USER_HSE_NOT_REMAPPED
#define OB_USER_INPUT_RESET_HOLDER
#define OB_USER_IOHSLV
#define OB_USER_IO_VDDIO2_HSLV
#define OB_USER_IO_VDD_HSLV
#define OB_USER_IRHEN
#define OB_USER_IWDG1_SW
#define OB_USER_IWDG2_SW
#define OB_USER_IWDG_STDBY
#define OB_USER_IWDG_STOP
#define OB_USER_IWDG_SW
#define OB_USER_NBOOT0
#define OB_USER_NBOOT1
#define OB_USER_NBOOT_SEL
#define OB_USER_NRST_MODE
#define OB_USER_NRST_SHDW
#define OB_USER_NRST_STDBY
#define OB_USER_NRST_STDBY_D1
#define OB_USER_NRST_STDBY_D2
#define OB_USER_NRST_STOP
#define OB_USER_NRST_STOP_D1
#define OB_USER_NRST_STOP_D2
#define OB_USER_NSWBOOT0
#define OB_USER_PA15_PUPEN
#define OB_USER_PB4_PUPEN
#define OB_USER_RAM_PARITY_CHECK
#define OB_USER_SECURE_MUXING_EN
#define OB_USER_SECURITY
#define OB_USER_SRAM1_3_RST
#define OB_USER_SRAM1_ECC
#define OB_USER_SRAM1_RST
#define OB_USER_SRAM2_ECC
#define OB_USER_SRAM2_PE
#define OB_USER_SRAM2_RST
#define OB_USER_SRAM3_ECC
#define OB_USER_SRAM_PE
#define OB_USER_SRAM_RST
#define OB_USER_ST_RAM_SIZE
#define OB_USER_SWAP_BANK
#define OB_USER_TZEN
#define OB_USER_USBPD_DIS
#define OB_USER_VDDMMC_HSLV
#define OB_USER_WWDG_SW
#define OB_USER_nBOOT0
#define OB_USER_nBOOT1
#define OB_USER_nBOOT_SEL
#define OB_USER_nRST_SHDW
#define OB_USER_nRST_STDBY
#define OB_USER_nRST_STOP
#define OB_USER_nSWBOOT0
#define OB_USER_IWDG1_SW
#define OB_USER_IWDG2_SW
#define OB_USER_NRST_STDBY_D1
#define OB_USER_NRST_STDBY_D2
#define OB_USER_NRST_STOP_D1
#define OB_USER_NRST_STOP_D2
/*OPTIONBYTE*/
#define OPTIONBYTE_ALL
#define OPTIONBYTE_BOOTADD
#define OPTIONBYTE_BOOTADDR
#define OPTIONBYTE_BOOTCONFIG
#define OPTIONBYTE_BOOT_LOCK
#define OPTIONBYTE_BOR
#define OPTIONBYTE_CM4_BOOTADD
#define OPTIONBYTE_CM7_BOOTADD
#define OPTIONBYTE_FREQ_BOOST
#define OPTIONBYTE_HDP
#define OPTIONBYTE_PCROP
#define OPTIONBYTE_PROD_STATE
#define OPTIONBYTE_RDP
#define OPTIONBYTE_SEC
#define OPTIONBYTE_SECURE_AREA
#define OPTIONBYTE_SHARED_RAM
#define OPTIONBYTE_USER
#define OPTIONBYTE_WMSEC
#define OPTIONBYTE_WRP
|
In HAL2, these constants have been removed and replaced by dedicated unitary APIs for each user
option byte configuration (e.g:
For more details, refer to: |
|
Example :
To enable SRAM1 ECC and set
/* Example: enable SRAM1 ECC and configure nBOOT0
to boot from the option bytes */
FLASH_OBProgramInitTypeDef ob = {0};
/* select the dedicated option byte groups */
ob.OptionType = OPTIONBYTE_USER | OPTIONBYTE_BOOTADDR;
/* fetch current USERConfig */
HAL_FLASHEx_OBGetConfig(&ob);
/* enable SRAM1 ECC */
ob.USERConfig |= OB_USER_SRAM1_ECC;
/* set nBOOT0 to boot from option byte */
ob.USERConfig &= ~OB_USER_nBOOT0;
/* program the updated USERConfig */
HAL_FLASHEx_OBProgram(&ob);
|
In HAL2, the same configuration can be achieved with the following code: /* Example: enable SRAM1 ECC and configure nBOOT0
to boot from the option bytes */
HAL_FLASH_ITF_OB_EnableSRAMECC(HAL_FLASH,
HAL_FLASH_ITF_OB_SRAM1);
HAL_FLASH_ITF_OB_SetBoot0(HAL_FLASH,
HAL_FLASH_ITF_OB_BOOT_LOW);
HAL_FLASH_ITF_OB_SetNSecureBootAddr(HAL_FLASH,
HAL_FLASH_ITF_OB_ADDR_0,
boot_addr)
|
Related concepts:
Related use case:
HAL FLASH option byte BOOT0/BOOT1 source selection constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_BOOT1_SRAM
#define OB_BOOT1_SYSTEM
#define OB_BOOT0_FROM_PIN
#define OB_BOOT0_FROM_OB
#define OB_BOOT0_RESET
#define OB_BOOT0_SET
/* OR */
#define OB_NBOOT0_RESET
#define OB_NBOOT0_SET
/* OR */
#define OB_nBOOT0_RESET
#define OB_nBOOT0_SET
Note These defines are series-dependent. |
typedef enum
{
HAL_FLASH_ITF_OB_BOOT_LOW,
HAL_FLASH_ITF_OB_BOOT_HIGH
} hal_flash_itf_ob_boot_state_t;
HAL_FLASH_ITF_OB_SetBoot1(HAL_FLASH , hal_flash_itf_ob_boot_state_t state);
typedef enum
{
HAL_FLASH_ITF_OB_BOOT_PIN
HAL_FLASH_ITF_OB_BOOT_OPTION_BIT
} hal_flash_itf_ob_boot_selection_t;
- Use HAL_FLASH_ITF_OB_SetBootSelection(hal_flash_t instance, hal_flash_itf_ob_boot_selection_t boot_select)
typedef enum
{
HAL_FLASH_ITF_OB_BOOT_LOW
HAL_FLASH_ITF_OB_BOOT_HIGH
} hal_flash_itf_ob_boot_state_t;
- Use HAL_FLASH_ITF_OB_SetBoot0(hal_flash_t instance, hal_flash_itf_ob_boot_state_t state)
|
Related concepts:
Related use case:
HAL FLASH option byte boot address regions constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_BOOTADDR_NS0
#define OB_BOOTADDR_NS1
/* OR */
#define OB_BOOT_NS
#define OB_BOOTADDR_SEC0
/* OR */
#define OB_BOOT_SEC
Note
These are used by
|
typedef enum
{
HAL_FLASH_ITF_OB_ADDR_0
HAL_FLASH_ITF_OB_ADDR_1
} hal_flash_itf_ob_addr_idx_t;
To use with:
For the secure boot use:
|
Related concepts:
Related use case:
HAL FLASH option byte forced boot entry constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_BOOT_ENTRY_FORCED_NONE
/* OR */
#define OB_BOOT_LOCK_ENABLE
#define OB_BOOT_ENTRY_FORCED_FLASH
/* OR */
#define OB_BOOT_LOCK_DISABLE
Note These defines are series-dependent. |
Removed in HAL2, use the following unitary APIs: HAL_FLASH_ITF_OB_LockBootConfig(hal_flash_t instance)
HAL_FLASH_ITF_OB_UnlockBootConfig(hal_flash_t instance)
|
Related concepts:
Related use case:
HAL FLASH option byte BORH enable/disable constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_BOR_ENABLE
/* OR */
#define OB_BORH_ENABLE
#define OB_BOR_DISABLE
/* OR */
#define OB_BORH_DISABLE
Note
|
Removed in HAL2, use the following unitary APIs: HAL_FLASH_ITF_OB_EnableBORDetection(hal_flash_t instance);
HAL_FLASH_ITF_OB_DisableBORDetection(hal_flash_t instance);
|
Related concepts:
Related use case:
HAL FLASH option byte BOR level identifiers constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_BOR_LEVEL0
/* OR */
#define OB_BOR_LEVEL_0
/* OR */
#define OB_BOR_OFF
#define OB_BOR_LEVEL1
/* OR */
#define OB_BOR_LEVEL_1
#define OB_BOR_LEVEL2
/* OR */
#define OB_BOR_LEVEL_2
#define OB_BOR_LEVEL3.
/* OR */
#define OB_BOR_LEVEL_3
define OB_BOR_LEVEL_4
|
typedef enum
{
HAL_FLASH_ITF_OB_BOR_LEVEL_0,
HAL_FLASH_ITF_OB_BOR_LEVEL_1,
HAL_FLASH_ITF_OB_BOR_LEVEL_2,
HAL_FLASH_ITF_OB_BOR_LEVEL_3,
HAL_FLASH_ITF_OB_BOR_LEVEL_4
} hal_flash_itf_ob_bor_level_t;
Use
|
Related concepts:
Related use case:
HAL FLASH option byte BOR falling level identifiers constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_BOR_LEVEL_FALLING_0
#define OB_BOR_LEVEL_FALLING_1
#define OB_BOR_LEVEL_FALLING_2
#define OB_BOR_LEVEL_FALLING_3
|
typedef enum
{
HAL_FLASH_ITF_OB_BOR_LEVEL_0,
HAL_FLASH_ITF_OB_BOR_LEVEL_1,
HAL_FLASH_ITF_OB_BOR_LEVEL_2,
HAL_FLASH_ITF_OB_BOR_LEVEL_3
} hal_flash_itf_ob_bor_level_t;
Use
|
Related concepts:
Related use case:
HAL FLASH option byte BOR rising level identifiers constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_BOR_LEVEL_RISING_0
#define OB_BOR_LEVEL_RISING_1
#define OB_BOR_LEVEL_RISING_2
#define OB_BOR_LEVEL_RISING_3
|
typedef enum
{
HAL_FLASH_ITF_OB_BOR_LEVEL_0,
HAL_FLASH_ITF_OB_BOR_LEVEL_1,
HAL_FLASH_ITF_OB_BOR_LEVEL_2,
HAL_FLASH_ITF_OB_BOR_LEVEL_3
} hal_flash_itf_ob_bor_level_t;
Use
|
Related concepts:
Related use case:
HAL FLASH option byte Dbank size constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_DUALBANK_SINGLE
#define OB_DUALBANK_DUAL
#define OB_DBANK_128_BITS
#define OB_DBANK_64_BITS
|
typedef enum
{
HAL_FLASH_ITF_OB_SINGLE_BANK,
HAL_FLASH_ITF_OB_DUAL_BANK,
/* Equivalent enum not yet implemented in HAL2*/
} hal_flash_itf_ob_topology_t;
Use
|
Related concepts:
Related use case:
HAL FLASH option byte HSE not remapped constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_HSE_NOT_REMAPPED_DISABLE
#define OB_HSE_NOT_REMAPPED_ENABLE
|
Removed in HAL2, use the following unitary APIs: HAL_FLASH_ITF_OB_EnableHSEPinRemap(hal_flash_t instance)
HAL_FLASH_ITF_OB_DisableHSEPinRemap(hal_flash_t instance)
|
Related concepts:
Related use case:
HAL FLASH option byte IOHSLV enable/disable constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_IOHSLV_ENABLE
#define OB_IO_VDDIO2_HSLV_ENABLE
#define OB_IO_VDD_HSLV_ENABLE
#define OB_VDDMMC_HSLV_ENABLE
#define OB_IOHSLV_DISABLE
#define OB_IO_VDDIO2_HSLV_DISABLE
#define OB_IO_VDD_HSLV_DISABLE
#define OB_VDDMMC_HSLV_DISABLE
Note These defines are series-dependent. |
Note
Possible values for
|
Related concepts:
Related use case:
HAL FLASH option byte IRH enable/disable constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_IRH_DISABLE
#define OB_IRH_ENABLE
|
typedef enum
{
HAL_FLASH_ITF_OB_RST_PULSE_PIN_LOW,
HAL_FLASH_ITF_OB_RST_HOLD_PIN_LOW
} hal_flash_itf_ob_pin_rst_mode_t;
Use
|
Related concepts:
Related use case:
HAL FLASH option byte IWDG1/IWDG2 HW/SW constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_IWDG1_HW
#define OB_IWDG2_HW
#define OB_IWDG_HW
#define OB_IWDG1_SW
#define OB_IWDG2_SW
/* OR */
#define OB_IWDG_SW
Note These defines are series-dependent. |
typedef enum
{
HAL_FLASH_ITF_OB_WDG_HARDWARE
HAL_FLASH_ITF_OB_WDG_SOFTWARE
} hal_flash_itf_ob_wdg_mode_t;
Use
|
Related concepts:
HAL FLASH option byte independent watchdog modes constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_IWDG_STDBY_FREEZE
#define OB_IWDG_STOP_FREEZE
#define OB_IWDG_STDBY_RUN
#define OB_IWDG_STOP_RUN
/* OR */
#define OB_IWDG_STDBY_ACTIVE
#define OB_IWDG_STOP_ACTIVE
Note These defines are series-dependent. |
Removed in HAL2, replaced by unitary API:
Note Possible values for low_pwr_mode parameter is provided as a set of defines in the following form:
|
Related concepts:
Related use case:
HAL FLASH option byte security options ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_SECURITY_DISABLE
#define OB_SECURITY_ENABLE
|
Removed in HAL2, use the following APIs: HAL_FLASH_ITF_OB_DisablePageSecProtection(HAL_FLASH)
HAL_FLASH_ITF_OB_EnablePageSecProtection(HAL_FLASH)
|
Related concepts:
Related use case:
HAL FLASH option byte security area options ¶
|
HAL1 |
HAL2 |
|---|---|
#define OPTIONBYTE_SEC
|
Removed
in HAL2, replaced by unitary API:
|
Related concepts:
HAL FLASH option byte NRST modes constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_RESET_MODE_INPUT_ONLY
/*OR*/
#define OB_NRST_MODE_INPUT_ONLY
#define OB_RESET_MODE_GPIO
/*OR*/
#define OB_NRST_MODE_GPIO
#define OB_RESET_MODE_INPUT_OUTPUT
/*OR*/
#define OB_NRST_MODE_INPUT_OUTPUT
|
typedef enum
{
HAL_FLASH_OB_NRST_PIN_INPUT_ONLY,
HAL_FLASH_OB_NRST_PIN_STANDARD_GPIO,
HAL_FLASH_OB_NRST_PIN_BIDIRECTIONAL
} hal_flash_itf_ob_nrst_pin_mode_t;
Use
|
Related concepts:
HAL FLASH option byte NRST modes constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_SHUTDOWN_NORST
#define OB_SHUTDOWN_RST
#define OB_STANDBY_NORST
#define OB_STANDBY_RST
#define OB_STDBY_NO_RST_D1
#define OB_STDBY_RST_D1
#define OB_STDBY_NO_RST_D2
#define OB_STDBY_RST_D2
#define OB_STDBY_NO_RST
#define OB_STDBY_RST
#define OB_STOP_NO_RST
#define OB_STOP_NORST
#define OB_STOP_RST
#define OB_STOP_NO_RST_D1
#define OB_STOP_NO_RST_D2
#define OB_STOP_RST_D1
#define OB_STOP_RST_D2
Note These defines are series-dependent. |
typedef enum
{
HAL_FLASH_ITF_OB_RST_GENERATION,
HAL_FLASH_ITF_OB_NO_RST_GENERATION
} hal_flash_itf_ob_rst_generation_status_t;
Use
Note
Possible values for
|
Related concepts:
Related use case:
HAL FLASH option byte Pin pull-up constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_PA15_PUP_DISABLE
#define OB_PA15_PUP_ENABLE
#define OB_PB4_PUPEN_DISABLE
#define OB_PB4_PUPEN_ENABLE
|
In HAL2, the defines have been split into an enumeration to specify the pull mode and a defined pin identifier
(eg:
typedef enum
{
HAL_FLASH_ITF_OB_PULL_NO,
HAL_FLASH_ITF_OB_PULL_DOWN,
HAL_FLASH_ITF_OB_PULL_UP
} hal_flash_itf_ob_pull_mode_t;
|
Related concepts:
Related use case:
HAL FLASH option byte PCROP zone identifiers constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_PCROP_ZONE_A
#define OB_PCROP_ZONE2_A
#define OB_PCROP_ZONE_B
#define OB_PCROP_ZONE2_B
|
In HAL2, the defines have been split into an enumeration to specify the bank area and a flash bank identifier, which are used as parameters in the function
typedef enum
{
HAL_FLASH_ITF_OB_BANK_AREA_A,
HAL_FLASH_ITF_OB_BANK_AREA_B
} hal_flash_itf_ob_bank_area_t;
typedef enum
{
HAL_FLASH_BANK_1,
HAL_FLASH_BANK_2,
HAL_FLASH_BANK_ALL
} hal_flash_bank_t;
|
Related concepts:
Related use case:
HAL FLASH option byte production states constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_PROD_STATE_OPEN
#define OB_PROD_STATE_PROVISIONING
#define OB_PROD_STATE_IROT_PROVISIONED
#define OB_PROD_STATE_TZ_CLOSED
#define OB_PROD_STATE_CLOSED
#define OB_PROD_STATE_LOCKED
#define OB_PROD_STATE_REGRESSION
#define OB_PROD_STATE_NS_REGRESSION
|
typedef enum
{
HAL_FLASH_ITF_OB_PRODUCT_STATE_OPEN,
HAL_FLASH_ITF_OB_PRODUCT_STATE_PROVISIONING,
HAL_FLASH_ITF_OB_PRODUCT_STATE_IROT_PROVISIONED,
HAL_FLASH_ITF_OB_PRODUCT_STATE_TZ_CLOSED,
HAL_FLASH_ITF_OB_PRODUCT_STATE_CLOSED,
HAL_FLASH_ITF_OB_PRODUCT_STATE_LOCKED,
HAL_FLASH_ITF_OB_PRODUCT_STATE_REGRESSION,
HAL_FLASH_ITF_OB_PRODUCT_STATE_NS_REGRESSION
} hal_flash_itf_ob_product_state_t;
Use
|
Related concepts:
HAL FLASH option byte RDP OEM keys constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_RDP_KEY_OEM1
#define OB_RDP_KEY_OEM2
#define OPTIONBYTE_RDPKEY
|
Removed in HAL2, replaced by LL: #define LL_FLASH_OB_OEM_1 /* These keys are now */
#define LL_FLASH_OB_OEM_2 /* defined in the LL file */
In HAL:
typedef struct {
uint32_t key_w1;
uint32_t key_w2;
...
} hal_flash_itf_ob_rdp_oem_key_t;
/* APIs to set the OEM keys */
HAL_FLASH_ITF_OB_SetRDPOEM1Key(HAL_FLASH, hal_flash_itf_ob_rdp_oem_key_t *p_key);
HAL_FLASH_ITF_OB_SetRDPOEM2Key(HAL_FLASH, hal_flash_itf_ob_rdp_oem_key_t *p_key);
|
Related concept:
HAL FLASH option byte read protection levels constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_RDP_LEVEL_0
#define OB_RDP_LEVEL_0_5
#define OB_RDP_LEVEL_1
#define OB_RDP_LEVEL_2
|
typedef enum
{
HAL_FLASH_ITF_OB_RDP_LEVEL_0,
HAL_FLASH_ITF_OB_RDP_LEVEL_0_5,
HAL_FLASH_ITF_OB_RDP_LEVEL_1,
HAL_FLASH_ITF_OB_RDP_LEVEL_2
} hal_flash_itf_ob_rdp_level_t;
|
Related concept:
HAL FLASH option byte secure muxing constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_SECURE_MUXING_ENABLE
#define OB_SECURE_MUXING_DISABLE
|
Removed in HAL2, replaced by unitary APIs: HAL_FLASH_ITF_OB_EnableSecMux(HAL_FLASH)
HAL_FLASH_ITF_OB_DisableSecMux(HAL_FLASH)
|
Related concept:
HAL FLASH option byte CPU freq boost ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_CPUFREQ_BOOST_DISABLE
#define OB_CPUFREQ_BOOST_ENABLE
|
Removed in HAL2, replaced by unitary APIs: HAL_FLASH_ITF_OB_DisableBoostCoreFreq(HAL_FLASH)
HAL_FLASH_ITF_OB_EnableBoostCoreFreq(HAL_FLASH)
|
Related concept:
HAL FLASH option byte secure RDP erase constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_SECURE_RDP_ERASE
#define OB_SECURE_RDP_NOT_ERASE
#define OB_PCROP_RDP_ERASE
#define OB_PCROP_RDP_NOT_ERASE
Note These defines are series-dependent. |
Removed in HAL2, replaced by unitary APIs: For erase use: HAL_FLASH_ITF_OB_EnablePCROPEraseRDPRegression(HAL_FLASH)
For check use: HAL_FLASH_ITF_OB_IsEnabledPCROPEraseRDPRegression(HAL_FLASH)
|
Related concepts:
Related use case:
HAL FLASH option byte SRAM reset erase modes constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_SRAM_RST_ERASE
#define OB_SRAM1_3_RST_ERASE
#define OB_SRAM2_RST_ERASE
#define OB_SRAM1_RST_ERASE
#define OB_SRAM_RST_NOT_ERASE
#define OB_SRAM1_3_RST_NOT_ERASE
#define OB_SRAM2_RST_NOT_ERASE
#define OB_SRAM1_RST_NOT_ERASE
|
In HAL2, the defines have been split into an enumeration to specify the SRAM erase mode
and a list of defines to specify the SRAM identifier,
which are used as parameters in the function:
typedef enum
{
HAL_FLASH_ITF_OB_SYS_RST_SRAM_NO_ERASE
HAL_FLASH_ITF_OB_SYS_RST_SRAM_ERASE
} hal_flash_itf_ob_sys_rst_sram_erase_t;
#define HAL_FLASH_ITF_OB_SRAM1
#define HAL_FLASH_ITF_OB_SRAM2
#define HAL_FLASH_ITF_OB_SRAM3
...
|
Related concepts:
HAL FLASH option byte SRAM ECC and reset erase modes constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_SRAM1_ECC_DISABLE
#define OB_SRAM2_ECC_DISABLE
#define OB_SRAM3_ECC_DISABLE
#define OB_SRAM1_ECC_ENABLE
#define OB_SRAM2_ECC_ENABLE
#define OB_SRAM3_ECC_ENABLE
|
In HAL2, the defines have been replaced by a list of defines to specify the SRAM identifier.
which are used as parameters in the functions:
#define HAL_FLASH_ITF_OB_SRAM1
#define HAL_FLASH_ITF_OB_SRAM2
#define HAL_FLASH_ITF_OB_SRAM3
...
|
HAL FLASH option byte SRAM parity constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_SRAM2_PARITY_DISABLE
/* OR */
#define OB_SRAM_PARITY_DISABLE
#define OB_SRAM_PARITY_ENABLE
/* OR */
#define OB_SRAM2_PARITY_ENABLE
|
Removed in HAL2, use the following unitary APIs: HAL_FLASH_ITF_OB_DisableSRAMParityCheck(HAL_FLASH)
HAL_FLASH_ITF_OB_EnableSRAMParityCheck(HAL_FLASH)
|
HAL FLASH option byte swap bank enable/disable constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_SWAP_BANK_DISABLE
#define OB_SWAP_BANK_ENABLE
|
typedef enum
{
HAL_FLASH_ITF_OB_BANK_NO_SWAP,
HAL_FLASH_ITF_OB_BANK_SWAP
} hal_flash_itf_ob_bank_swap_t;
|
Related concept:
HAL FLASH option byte trustZone enable/disable constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_TZEN_ENABLE
#define OB_TZEN_DISABLE
|
Removed in HAL2, use the following unitary APIs: HAL_FLASH_ITF_OB_EnableTrustZone(HAL_FLASH)
HAL_FLASH_ITF_OB_DisableTrustZone(HAL_FLASH)
|
Related concepts:
HAL FLASH option byte UBE (Unique BOOT Entry) modes constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_UBE_ST_IROT
#define OB_UBE_OEM_IROT
|
typedef enum
{
HAL_FLASH_ITF_OB_UNIQUE_BOOT_SYSTEM_FLASH ,
HAL_FLASH_ITF_OB_UNIQUE_BOOT_USER_FLASH
} hal_flash_itf_ob_unique_boot_entry_t;
Use
|
Related concepts:
HAL FLASH option byte WMSEC areas constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_WMSEC_AREA1
#define OB_WMSEC_AREA2
#define OB_WMSEC_SECURE_AREA_CONFIG
#define OB_WMSEC_HDP_AREA_CONFIG
#define OB_WMSEC_HDP_AREA_DISABLE
#define OB_WMSEC_HDP_AREA_ENABLE
|
Removed in HAL2, use the following APIs: For watermark configuration use: HAL_FLASH_ITF_OB_SetSecureWMArea(HAL_FLASH, hal_flash_bank_t bank, uint32_t start_page, uint32_t page_nbr)
For HDP configuration use: HAL_FLASH_ITF_SetHDPLevel(HAL_FLASH, hal_flash_itf_hdp_level_t hdp_level)
HAL_FLASH_ITF_OB_EnableHDPArea(HAL_FLASH, hal_flash_bank_t bank)
HAL_FLASH_ITF_OB_DisableHDPArea(HAL_FLASH, hal_flash_bank_t bank)
|
Related concept:
HAL FLASH option byte write protection configuration ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_WRPAREA_BANK1_AREAA
#define OB_WRPAREA_BANK2_AREAA
#define OB_WRPAREA_ZONE_A
#define OB_WRPAREA_ZONE2_A
#define OB_WRPAREA_BANK1_AREAB
#define OB_WRPAREA_BANK2_AREAB
#define OB_WRPAREA_ZONE_B
#define OB_WRPAREA_ZONE2_B
|
In HAL2, the defines have been split into an enumeration to specify the bank area and an enumeration
to specify flash bank identifier, which are used as parameters in the function:
typedef enum
{
HAL_FLASH_ITF_OB_BANK_AREA_A,
HAL_FLASH_ITF_OB_BANK_AREA_B
} hal_flash_itf_ob_bank_area_t;
typedef enum
{
HAL_FLASH_BANK_1,
HAL_FLASH_BANK_2,
HAL_FLASH_BANK_ALL
} hal_flash_bank_t;
|
Related concept:
HAL FLASH option byte write protection state constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_WRPSTATE_DISABLE
#define OB_WRPSTATE_ENABLE
|
Removed in HAL2, use the following unitary APIs: HAL_FLASH_ITF_OB_LockWRPAreaConfig(HAL_FLASH, hal_flash_bank_t bank, hal_flash_itf_ob_bank_area_t area)
HAL_FLASH_ITF_OB_UnlockWRPAreaConfig(HAL_FLASH, hal_flash_bank_t bank, hal_flash_itf_ob_bank_area_t area)
|
Related concept:
HAL FLASH option byte window watchdog modes constants ¶
|
HAL1 |
HAL2 |
|---|---|
#define OB_WWDG_HW
#define OB_WWDG_SW
|
typedef enum
{
HAL_FLASH_ITF_OB_WDG_HARDWARE,
HAL_FLASH_ITF_OB_WDG_SOFTWARE
} hal_flash_itf_ob_wdg_mode_t;
Use
|
Related concepts:
HAL FLASH option byte EDATA configurations ¶
|
HAL1 |
HAL2 |
|---|---|
#define OPTIONBYTE_EDATA
|
Removed in HAL2, use the following unitary APIs: HAL_FLASH_ITF_OB_SetEDATAPageArea(HAL_FLASH, hal_flash_bank_t bank, uint32_t page_nbr)
HAL_FLASH_ITF_OB_EnableEDATAArea(HAL_FLASH, hal_flash_bank_t bank)
HAL_FLASH_ITF_OB_DisableEDATAArea(HAL_FLASH, hal_flash_bank_t bank)
|
Related concepts:
HAL FLASH option byte OTP configurations ¶
|
HAL1 |
HAL2 |
|---|---|
#define OPTIONBYTE_OTP_LOCK
|
Removed in HAL2, use the following unitary API: HAL_FLASH_ITF_OB_LockOTPBlock(hal_flash_t instance, uint32_t start_otp_block, uint32_t otp_block_nbr)
|
Related concept:
HAL FLASH procedure types with bank ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_PROC_ALLBANK_MASSERASE
#define FLASH_PROC_MASSERASE_BANK1
#define FLASH_PROC_MASSERASE_BANK2
#define FLASH_PROC_PROGRAM_BANK1
#define FLASH_PROC_PROGRAM_BANK2
#define FLASH_PROC_SECTERASE_BANK1
#define FLASH_PROC_SECTERASE_BANK2
|
Those constants are used within the
|
Related concept:
HAL FLASH procedure types ¶
|
HAL1 |
HAL2 |
|---|---|
#define FLASH_PROC_MASSERASE
#define FLASH_PROC_MASS_ERASE
#define FLASH_PROC_NONE
#define FLASH_PROC_PAGE_ERASE
#define FLASH_PROC_PROGRAM
#define FLASH_PROC_PROGRAM_LAST
#define FLASH_PROC_SECTERASE
|
Those constants are used within the
|
Related concept: